package youtube_javvidjv;

class MyThread extends Thread {
	public void run() {
		System.out.println("Dennis");
	}
}

class MyRunnable implements Runnable {
	public void run() {
		System.out.println("Fernandes");
	}
}

public class TestThread {
	public static void main(String[] args) {
		// Instanciando a thread que eu criei
		MyThread myThread = new MyThread();
		// Instanciando a classe que implementa Runnable
		MyRunnable myRunnable = new MyRunnable();
		// startando a thread que criei
		myThread.start();
		// Criando duas thread e passando a classe que 
		//implementa Runnable pelo construtor
		Thread thread_01 = new Thread(myRunnable);
		Thread thread_02 = new Thread(myRunnable);
		// startando as threads que criei com a interface
		thread_01.start();
		thread_02.start();
		
	}
}


